<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
  <meta name="viewport"
    content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
  <link rel="stylesheet" href="//at.alicdn.com/t/c/font_3436936_s1erdg5cg9.css">
  <title>beijing</title>
</head>

<body>
  <div id="app"></div>
  <!-- built files will be auto injected -->

  <script>
    // 设备可视宽度
    // document.documentElement.clientWidth
    change()
    function change() {
      document.documentElement.style.fontSize = (document.documentElement.clientWidth || document.body.clientWidth) * 50 / 750 + 'px'
      console.log("1rem=" + (document.documentElement.clientWidth || document.body.clientWidth) * 50 / 750 + 'px');
    }
    // 窗口大小改变事件
    window.onresize = function () {
      change()
    }
  </script>
</body>

</html>